﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewInCalendar.aspx.cs"
    Inherits="ZX.WebApp.Crm.Hodometer.NewInCalendar" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <!-- OPTIONAL: JSON Utility (for DataSource) -->
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>
    <link rel="stylesheet" href="style/StyleSheet1.css" />
    <link href="../../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <link href="../../Styles/default/calendar.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/extend.validate.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.calendar.js" type="text/javascript"></script>
    <style type="text/css">
        #TextArea1
        {
            height: 23px;
            width: 777px;
        }
    </style>
    <script type="text/javascript">
        function AlertResult(obj) {
            if (obj) {
                alert("操作成功！");
                //parent.NeedRefreshPage.myrefresh();
            }
            else
            { alert("操作失败！") }
            window.parent.$("#tabs").tabs('close', '新增讲师行程');
        }
        var entity = function (ID, Caption, ProductCode, ProductTypeName, UnitName, Amount, AccountReceivable, ProductResignMoney)
        {
            this.ID = ID;
            this.Caption = Caption;
            this.ProductCode = ProductCode;
            this.ProductTypeName = ProductTypeName;
            this.UnitName = UnitName;
            this.Amount = Amount;
            this.AccountReceivable = AccountReceivable;
            this.ProductResignMoney = ProductResignMoney;
        },
        action = "insert",
        flag = "0",
        ListRecord = [];
        var CrmProduct = [];
        var DeliverMajorInfo = [[]];
        var myDataSource1, mDataTable1;
        var btnSave = "", btnClose = "",
        condition = "";  
        //只取一个URL参数：
        var queryString = function (key) {
            return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
        }
    </script>
    
</head>
<body class="yui-skin-sam" onload="loadPara();">
    <form id="form1" runat="server">
    <div>
        <table  class="tableContent">
            <tr>
                <td colspan="6" align="center" style="height: 40px; font-weight: bold; font-size: 30px;">
                    新增讲师行程表
                </td>
            </tr>
            <tr>
                <td align="left" width="75px">
                    &nbsp;订单号：</td>
                <td>
                    <input type="hidden" id="OrderProductID" name="OrderProductID" runat="server" />
                    <input type="text" id="txtOrderProductID" name="txtOrderProductID" disabled="disabled"
                        runat="server" style="width: 78%; background: #e7eaf4;" />
                    <button id="btnOrderProductID" style="width: 15%;"  name="4" type="button" runat="server" 
                       class="btnCheck">
                        选择</button>
                </td>
                <td align="left" width="75px">
                    &nbsp;客户编码：
                </td>
                <td><input type="text" id="CustomerCode" disabled="disabled" style="width: 95%; background: #e7eaf4;" />
                </td>
                <td align="left" width="75px">
                    &nbsp;客户名称：
                </td>
                <td>
                    <input type="text" id="CustomerName" disabled="disabled" style="width: 95%; background: #e7eaf4;" />
                </td>
            </tr>
            <tr>
                <td align="left">
                    &nbsp;客户经理：
                </td>
                <td>
                    <input type="text" id="CustomerMgrName" disabled="disabled" style="width: 95%; background: #e7eaf4;" />
                </td>
                <td align="left">
                    &nbsp;行销顾问：
                </td>
                <td>
                    <input type="text" id="SaleaddName" disabled="disabled" style="width: 95%; background: #e7eaf4;" />
                </td>
                <td align="left">
                    &nbsp;信息专员：
                </td>
                <td>
                    <input type="text" id="AddUserName" disabled="disabled" style="width: 95%; background: #e7eaf4;" />
                </td>
            </tr>
            <tr>
                <td colspan="6">
                </td>
            </tr>
            <tr>
                <td align="left">
                    &nbsp;开始时间：
                </td>
                <td>
                    <input type="text" id="txtstartdate" style="width: 75px;"
                        runat="server" />
                          <asp:DropDownList ID="ddlStartMin" runat="server">
                        </asp:DropDownList>
                        <b>:</b>
                        <asp:DropDownList ID="ddlStartSec" runat="server">
                        </asp:DropDownList>
                </td>
                <td align="left">
                    &nbsp;结束时间：
                </td>
                <td>
                    <input type="text" id="txtenddate" style="width: 75px;" runat="server" />
                     <asp:DropDownList ID="ddlEndMin" runat="server">
                        </asp:DropDownList>
                        <b>:</b>
                        <asp:DropDownList ID="ddlEndSec" runat="server">
                        </asp:DropDownList>
                </td>
                <td align="left">
                    &nbsp;底色：
                </td>
                <td>
                    <asp:DropDownList ID="ddlcolor" runat="server" Width="120px">
                        <asp:ListItem style="color: red;" Value="">点击选择颜色</asp:ListItem>
                        <asp:ListItem style="color: Black;" Value="Black">黑色</asp:ListItem>
                        <asp:ListItem style="color: Blue;" Value="Blue">蓝色</asp:ListItem>
                        <asp:ListItem style="color: Brown;" Value="Brown">棕色</asp:ListItem>
                        <asp:ListItem style="color: DarkBlue;" Value="DarkBlue">深南色</asp:ListItem>
                        <asp:ListItem style="color: Gray;" Value="Gray">灰色</asp:ListItem>
                        <asp:ListItem style="color: Green;" Value="Green">绿色</asp:ListItem>
                        <asp:ListItem style="color: Orange;" Value="Orange">橙色</asp:ListItem>
                        <asp:ListItem style="color: Red;" Value="Red">红色</asp:ListItem>
                        <asp:ListItem style="color: Silver;" Value="Silver">银色</asp:ListItem>
                        <asp:ListItem style="color: SkyBlue;" Value="SkyBlue">天蓝色</asp:ListItem>
                        <asp:ListItem style="color: White;" Value="White">白色(无底色)</asp:ListItem>
                        <asp:ListItem style="color: Yellow;" Value="Yellow">黄色</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="left">
                    &nbsp;理由：
                </td>
                <td colspan="5">
                    <textarea id="reason" name="S1" title="长度不超过40个汉字" onKeyDown="showSetNum('reason','spSpans',40)" onKeyUp="showSetNum('reason','spSpans',40)" runat="server" style="width: 95%;"></textarea>   <span id="spSpans" class="span_font"></span>
                </td>
            </tr>
            <tr style="display:none">
                <td colspan="2"><span style="color:Red">备注：客户经理需填写内训交付申请单以及内训部秘书审核启动内训流程后，才能给该企业安排讲师行程</span></td>
            </tr>
            </table> 
            <div  id="con_1">

            </div> 
            <div style=" float:right; margin-top:20px; margin-right:50px;"><img src="../../Images/Peixun/save.bmp" title="保存" style="float: left; margin-left: 10px;
                        cursor: pointer" alt="保存" onclick="return Save();" />&nbsp;&nbsp;
                        
                        <asp:Button ID="btnDel" Text="删除" CssClass="btnCheck" Width="48px" Height="27px"  runat="server" OnClientClick="return confirm('您确定要删除该行程？')" OnClick="btnDel_OnClick">
                        </asp:Button>
                        </div>
        <div id="dialog1" class="yui-pe-content">
            <div class="hd">
                信息选择</div>
            <div class="bd"><input type="hidden" id="ID" runat="server" />
                <iframe id="EditUIWindow1" frameborder="0" src="" style="width: 100%; height: 100%;
                    margin: 0px; padding: 0px;"></iframe>
            </div>
        </div>
    </div>
    </form>
</body>

<script type="text/javascript">
    var btnSave = "", btnClose = "", condition = "";
    YAHOO.example.init = function () {
        function onButtonClick(p_oEvent) {
            switch (this.get("id")) {
                case "btnSave":
                    Save(0);
                    break;
                case "btnClose":
                    Close();
                    break;
                case "btnNew1":
                    handleAdd();
                    break;
                case "btnDelete1":
                    handleDelete();
                    break;
                default:
                    break;
            }
        }
        YAHOO.util.Event.onContentReady("toolbar", function () {
            btnSave = new YAHOO.widget.Button("btnSave");
            btnSave.on("click", onButtonClick);
            btnClose = new YAHOO.widget.Button("btnClose");
            btnClose.on("click", onButtonClick);
        });
        YAHOO.util.Event.onContentReady("con_two_1", function () {
            btnNews1 = new YAHOO.widget.Button("btnNew1");
            btnNews1.on("click", onButtonClick);
            btnDeletes1 = new YAHOO.widget.Button("btnDelete1");
            btnDeletes1.on("click", onButtonClick);
        });
    } ();
    /*客户选择对应的方法和ID*/
    var _fn, _id;
    function ShowDialog(fn, id, src)
    {
        _fn = fn;
        _id = id;
        document.getElementById("EditUIWindow1").src = src;
        YAHOO.example.container.dialog1.show();
    }
    YAHOO.namespace("example.container");
    YAHOO.util.Event.onDOMReady(function () {
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow1");
            if (editwindow) {
                editwindow.contentWindow.ChooseInfo();
                LoadOrderProductInfo();
            }
            YAHOO.example.container.dialog1.hide();
        };
        var handleCancel = function () {
            this.cancel();
        };
        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
					            { width: "580px",
					                height: "450px",
					                fixedcenter: true,
					                visible: false,
					                draggable: true,
					                close: true,
					                autofillheight: "body",
					                constraintoviewport: true,
					                buttons: [{ text: "确定", handler: handleSubmit, isDefault: true },
								            { text: "取消", handler: handleCancel}]
					            });
        YAHOO.example.container.dialog1.callback = { success: handleSuccess, failure: handleFailure };
        YAHOO.example.container.dialog1.render();
    });
    //根据订单产品ID获取订单信息
    var LoadOrderProductInfo = function () {
        var vCId = "OrderProductID='" + $("#OrderProductID").val() + "'";
        YAHOO.util.Connect.asyncRequest('GET', "../../Extend/AjaxData/JSONList.aspx?r=" + Math.random() + "&type=1&entity=V_CrmCustomerInfoOrder&customCondition=" + vCId + "", //条件 
        {success: function (res) {
            try {
                var str = res.responseText;
                var arr = []; var entity = {};  
                var obj = eval(str);
                $('#txtOrderProductID').val(obj[0].Code);
                $('#CustomerCode').val(obj[0].CustomerCode);
                $('#CustomerName').val(obj[0].CustomerName);
                $('#AddUserName').val(obj[0].AddUserName);
                $('#SaleaddName').val(obj[0].SaleadviserName);
                $('#CustomerMgrName').val(obj[0].CustomerMgrName);
                for (var i = 0; i < obj.length; i++) {
                    entity.ID = obj[i].ID;
                    entity.Caption = obj[i].Caption;
                    entity.ProductCode = obj[i].ProductCode;
                    entity.ProductTypeName = obj[i].ProductTypeName;
                    entity.UnitName = obj[i].UnitName;
                    entity.Amount = obj[i].Amount;
                    entity.AccountReceivable = obj[i].AccountReceivable;
                    entity.ProductResignMoney = obj[i].ProductResignMoney;
                    arr.push(entity);
                }
                CrmProduct = arr;
                SetFormValue1(CrmProduct);
            }
            catch (e) {
            }
            finally {
            }
        }, failure: function () { }
    });
}


//保存
function Save() {
    var orid = $("#OrderProductID").val();
    if (orid == null || orid == "") {
        alert("必须选择订单！");
        return false;
    }
   
     
    if ($('#txtstartdate').val() == "") {
        alert("开始时间不能为空");
        $('#txtstartdate').focus();
        return false;
    }
    if ($('#txtenddate').val() == "") {
        alert("结束时间不能为空");
        $('#txtenddate').focus();
        return false;
    }
    var fsm = $("#ddlStartMin").val();
    var fss = $("#ddlStartSec").val();
    var fem = $("#ddlEndMin").val();
    var fes = $("#ddlEndSec").val();   
    if ($('#txtstartdate').val() > $('#txtenddate').val()) {
        alert("结束时间不能小于开始时间");
        $('#txtenddate').focus();
        return false;
    }
    if ($('#txtstartdate').val() == $('#txtenddate').val()) {
        if (fsm > fem || (fsm == fem && fss >= fes)) {
            alert("结束时间不能小于开始时间");
            $('#txtenddate').focus();
            return false;
        }
    }     
    var sd =  $('#txtstartdate').val() + " " + fsm + ":" + fss + ":00";
    var ed =$('#txtenddate').val() + " " + fem + ":" + fes + ":00"; 


    var tea = queryString("TEAID");
    var col = $("#ddlcolor option:selected").val();
    var rea = $("#reason").val();
    if (col == "") {
        alert("提示: 请选择【底色】！");
        return false;
    }
    if (rea == "") {
        alert("提示: 请填写【理由】！");
        return false;
    }  
    $.post("NewInCalendar.ashx", { HID: queryString("HID"), orderid: orid, sttime: sd, edtime: ed, tchid: tea, reason: rea, color: col }, function (data) {
        pross(data);
    });
}
function pross(obj) {
    if (obj == 1) {
        alert("操作成功！");
        parent.NeedRefreshPage.myrefresh(getPar1("Setea"));
        window.parent.$("#tabs").tabs('close', "新增讲师行程");
    }
    else
        alert("操作失败！");
}
function checkDate(sdate1, edate2) {
    if (sdate1 != "" && edate2 != "") { //输入不为空时；
        // 对字符串进行处理
        // 以 - / 或 空格 为分隔符, 将日期字符串分割为数组
        var date1 = sdate1.split("-");
        var date2 = edate2.split("-");
        // 创建 Date 对象
        var myDate1 = new Date(date1[0], date1[1], date1[2]);
        var myDate2 = new Date(date2[0], date2[1], date2[2]);

        // 对日起进行比较
        if (myDate1 <= myDate2) {
            return true;
        } else {
            return false;
        }
    }
    else {
        return true;
    }
}
function loadPara() {
//    if (queryString("HID") == "") {
//        document.getElementById("txtstartdate").value = queryString("DATED");
//        document.getElementById("txtenddate").value = queryString("DATED");
//    }
    pageonload();
}
function pageonload() {
    var val = queryString("TYPE");
    if (val != null && val == "1") {
        document.getElementById("Left").style.display = "none";
        document.getElementById("right").style.width = "100%";
    }
}


var format1 = function (elCell, oRecord, oColumn, sData) {
    if (action == "insert" || flag == "2") {
        var str1 = [];
        var id = "id" + Math.random();
        str1.push("<option value='00'> </option>");
        str1.push("<select id='" + id + "' onchange='ChangeEvent1(this);' name='Code' style='width:95%;'>");
        str1.push("<option value='00'> </option>");
        for (var i = 0; i < CrmProduct.length; i++) {
            if (CrmProduct[i].Caption == sData)
            {
                str1.push("<option value='" + CrmProduct[i].Caption + "' selected>" + CrmProduct[i].Caption + "</option>");
            } else {
                str1.push("<option value='" + CrmProduct[i].Caption + "'>" + CrmProduct[i].Caption + "</option>");
            }
        }
        str1.push("</select>");
        elCell.innerHTML = str1.join("");
    }
}
var format2 = function (elCell, oRecord, oColumn, sData) {
    if (sData == ""||sData==null) {
        sData = "";
    }
    elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='ProductTypeName' style='width:95%; background: #e7eaf4;'>";
}
var format3 = function (elCell, oRecord, oColumn, sData) {
    elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='Caption' style='width:95%; background: #e7eaf4;'>";
}
var format4 = function (elCell, oRecord, oColumn, sData) {
    elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='Money' style='width:95%; background: #e7eaf4;'>";
}
var format5 = function (elCell, oRecord, oColumn, sData) {
    if (sData == "" || sData == null) {
        elCell.innerHTML = "<input type=\"text\" value=\"\" disabled='disabled' name='UnitName' style='width:95%; background: #e7eaf4;'>";
    } else {
        elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='UnitName' style='width:95%; background: #e7eaf4;'>";
    } 
}
var format6 = function (elCell, oRecord, oColumn, sData) {
    elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='AccountReceivable' style='width:95%; background: #e7eaf4;'>";
}
var format7 = function (elCell, oRecord, oColumn, sData) {
    if (sData == "" || sData == null) {
        elCell.innerHTML = "<input type=\"text\" value=\"\" disabled='disabled' name='ProductResignMoney' style='width:95%; background: #e7eaf4;'>";
    } else {
        elCell.innerHTML = "<input type=\"text\" value=\"" + sData + "\" disabled='disabled' name='ProductResignMoney' style='width:95%; background: #e7eaf4;'>";
    } 
}

YAHOO.util.Event.addListener(window, "load", function ()
{
    BindData();
    hideCol();
    LoadOrderProductInfo();
    //Reviewform();

    // document.getElementsByName("Code")[0];ProductCode, ProductTypeName
});
var BindData = function () {
    YAHOO.example.RowDataMod = function () {
        var myColumnDefs1 = [
            { key: "ID", label: "ID", resizeable: true },
            { key: "Caption", label: "产品名称", resizeable: true, formatter: format1 },
            { key: "ProductCode", label: "产品编码", resizeable: true, formatter: format3 },
            { key: "ProductTypeName", label: "产品类型", resizeable: true, formatter: format2 },
            { key: "Amount", label: "数量", resizeable: true, formatter: format4 },
            { key: "UnitName", label: "计量单位", resizeable: true, formatter: format5 },
            { key: "AccountReceivable", label: "应收金额", resizeable: true, formatter: format6 },
            { key: "ProductResignMoney", label: "已收金额", resizeable: true, formatter: format7 }
            ];
        myDataSource1 = new YAHOO.util.DataSource([{ ID: "", ProductCode: "", ProductTypeName: "", Caption: "",
            Amount: "", UnitName: "", AccountReceivable: "", ProductResignMoney: ""
        }]);
        myDataSource1.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
        myDataSource1.responseSchema = {
            fields: ["ID", "ProductCode", "ProductTypeName", "Caption", "Amount", "UnitName", "AccountReceivable", "ProductResignMoney"]
        };
        var myDataTable1 = new YAHOO.widget.DataTable("con_1",
            myColumnDefs1, myDataSource1, { selectionMode: "single" });
        mDataTable1 = myDataTable1;
        var i1 = 1,
            bReverseSorted1 = false;
        var trackReverseSorts1 = function (oArg) {
            bReverseSorted1 = (oArg.dir === YAHOO.widget.DataTable.CLASS_DESC);
        };
        myDataTable1.subscribe("rowMouseoverEvent", myDataTable1.onEventHighlightRow);
        myDataTable1.subscribe("rowMouseoutEvent", myDataTable1.onEventUnhighlightRow);
        myDataTable1.subscribe("rowClickEvent", myDataTable1.onEventSelectRow);
        myDataTable1.subscribe("checkboxClickEvent", function (oArgs) {
            var elCheckbox = oArgs.target;
            var oRecord = this.getRecord(elCheckbox);
            oRecord.setData("iSun_Selected", elCheckbox.checked);
        });
        GetFormValue();
        return {
            ds: myDataSource1,
            dt: myDataTable1
        };
    } ();
}
function hideCol() {
    mDataTable1.hideColumn(parseInt(0)); mDataTable1.refreshView();
}
var GetFormValue = function () {
    for (var i = 0; i < CrmProduct.length; i++) {
        SetFormValue1(CrmProduct);
    }
}
var SetFormValue1 = function (obj) {
    var arr = eval(obj);
    myDataSource1.liveData = arr;
    mDataTable1.getDataSource().sendRequest(null, { success: mDataTable1.onDataReturnInitializeTable }, mDataTable1);
}


var ChangeEvent1 = function (oArgs) {
    var f = oArgs.name;
    var v = oArgs.value;
    setValue2(f, v);
}
var setValue2 = function (f, v) {
    var recordID = mDataTable1.getSelectedRows()[0];
    var record = mDataTable1.getRecord(recordID);
    record._oData[f] = v;
    for (var i = 0; i < ListRecord.length; i++) {
        if (ListRecord[i].ID == v) {
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=TypeName]")[0]).val(ListRecord[i].TypeName);
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=ProductCode]")[0]).val(ListRecord[i].ProductCode);
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=Amount]")[0]).val(ListRecord[i].Amount);
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=ProductResignMoney]")[0]).val(ListRecord[i].ProductResignMoney);
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=UnitName]")[0]).val(ListRecord[i].UnitName);
            $($(event.srcElement.parentNode.parentNode.parentNode).find("input[name=AccountReceivable]")[0]).val(ListRecord[i].AccountReceivable);
        }
    }
}
$(document).ready(function () {
    $('#txtstartdate').cld();
    $('#txtenddate').cld();
    if ($("#OrderProductID").val() == "00000000-0000-0000-0000-000000000000") {
        $("#txtOrderProductID").val("");
        $("#OrderProductID").val("");
    }

});
</script>
</html>
